home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
os2
/
srefv112.zip
/
MACROEYE.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-05-08
|
3KB
|
102 lines
/* SRE-FILTER "macrospace monitor".
This utility will monitor REXX macrospace, and update
the SRE-FILTER "input file cache" when it detects that one of the
input files (i.e.; INITFILT, Replacement strings, Virtual directories)
has changed. It should be run concurrently with SRE-FILTER --
you should START it after, or just before, you start Go-serve.
Actually, you should start it AFTER the first hit to SRE-FILTER
(since SRE-FILTER loads stuff up when it's first hit, but not
afterwards).
You can give two arguments:
1 -- SleepSec : the number of seconds to wait before rechecking
The deafult is 60
2 -- maxseconds : the number of seconds to wait for SRE-FILTER to
become activated. If this program is started before SRE-FILTER
is activated (that is, before the first hit to SRE-FILTER),
it will wait maxseconds for such an activation. If none occurs,
it will exit.
The defaut is 300.
Caution: You should close down the process running this program after
closing GoServer (it does NOT detect that GoServe has been stopped).
Failure to do this may effect proper function of GoServe (say, if you
immediately restart GoServe).
*/
/* Load up advanced REXX functions */
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
parse arg sleepsec maxseconds
typlist='REPSTRGS INITFILT USER ALIAS INTERPRET VIRTUAL ACCESS '
if sleepsec="" then sleepsec=60
if maxseconds="" then maxseconds=300
say " Sleep seconds= " sleepsec " , seconds to wait for sref_ loading " maxseconds
maxiters=(maxseconds/sleepsec)
if maxiters=0 then maxiters=1
iters=0
tryme1: /* jump here if no sref_ functions */
iters=iters+1
if iters>maxiters then do
say " Timed out waiting for sref_ routines to be loaded into macrospace "
exit
end
signal on error name no_macro /* which macro */
signal on syntax name no_macro
gotit=0
flist=sref_list_infiles()
gotit=1
no_macro:
signal off error ; signal off syntax ;
if gotit=0 then do /* no sref routines */
say ' Iter# ' iters ' of ' maxiters ' ( no sref routines loaded, will try again in ' sleepsec ' seconds '
call syssleep sleepsec
signal tryme1
end /* Do */
interpret flist
TEMPDIR=directory()
/*
say " Input files are: "
say initfilt_file
say repstrgs_file
say alias_file
say access_file
say user_file
say interpret_file
say virtual_file
SAY TEMPDIR
*/
say " Checking/updating macrospace ... "
do mm=1 to 7
a1=strip(word(typlist,mm))
A=SREF_LOAD_MAC(tempdir,user_File,initfilt_file,repstrgs_File, ,
alias_file,interpret_file,virtual_file,access_file,a1)
/* Not needed, load_mac will say something
if a=1 then
say " Updated: " a1
*/
end
say " Sleeping for " sleepsec " seconds "
call syssleep sleepsec
iters=0
signal tryme1
exit